package com.bawei.park2211a.news

import androidx.lifecycle.MutableLiveData
import com.bawei.base.bean.NewsEntity
import com.bawei.base.mvvm.BaseViewModel
import com.bawei.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class AddNewsViewModel @Inject constructor(var apiService: ApiService):BaseViewModel(){
    var addNewsSuccess=MutableLiveData<NewsEntity>()
    fun addNews(newsEntity: NewsEntity){
        httpRequest({apiService.addNews(newsEntity)},{addNewsSuccess.postValue(it)})
    }

}